High Efficiency Video Coding (HEVC) is a new coding standard that has been developed in recent years. In the High Efficiency Video Coding (HEVC) system, the fixed-size macroblock of H.264/AVC is replaced by a flexible block, named coding unit (CU). Pixels in the CU share the same coding parameters to improve coding efficiency. A CU may begin with a largest CU (LCU), which is also referred as coded tree unit (CTU) in HEVC. In addition to the concept of coding unit, the concept of prediction unit (PU) is also introduced in HEVC. Once the splitting of CU hierarchical tree is done, each leaf CU is further split into one or more prediction units (PUs) according to prediction type and PU partition. Several coding tools for screen content coding have been developed. These tools related to the present invention are briefly reviewed as follow.
Palette Coding
During the development of HEVC screen content coding (SCC), several proposals have been disclosed to address palette-based coding. For example, a palette prediction and sharing technique is disclosed in JCTVC-N0247 (Guo et al., “RCE3: Results of Test 3.1 on Palette Mode for Screen Content Coding”, Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 14th Meeting: Vienna, AT, 25 Jul.-2 Aug. 2013 Document: JCTVC-N0247) and JCTVC-00218 (Guo et al., “Evaluation of Palette Mode Coding on HM-12.0+RExt-4.1”, Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 15th Meeting: Geneva, CH, 23 Oct.-1 Nov. 2013, Document: JCTVC-00218). In JCTVC-N0247 and JCTVC-00218, the palette of each color component is constructed and transmitted. The palette can be predicted (or shared) from its left neighboring CU to reduce the bitrate. All pixels within the given block are then coded using their palette indices. An example of encoding process according to JCTVC-N0247 is shown as follows.                1. Transmission of the palette: the color index table (also called palette table) size is first transmitted followed by the palette elements (i.e., color values).        2. Transmission of pixel values: the pixels in the CU are encoded in a raster scan order. For each group of one or more pixels, a flag for a run-based mode is first transmitted to indicate whether the “copy-index mode” or “copy-above mode” is being used.        2.1 “Copy-index mode”: In this run-based mode, a respective palette index is first signaled followed by a respective run value “palette_run” (e.g., M) representing the run value. The “copy-index mode” is also referred as “index” mode in some literature. The term “palette_run” may also be referred as “pixel_run” or simply “run” in this disclosure. The run value indicates that a total of M consecutive samples are all coded using run mode. No further information needs to be transmitted for the current position and the following M positions since they have the same palette index as that signaled in the bitstream. The palette index (e.g., i) may also be shared by all three color components, which means that the reconstructed pixel values are (Y, U, V)=(paletteY[i], paletteU[i], paletteV[i]) for the case of YUV color space.                    2.2 “Copy-above mode”: In the copy-above mode, a respective value “palette_run” (e.g. N) is transmitted to indicate that for the current pixel and the following N pixels, the palette index is the same as the corresponding palette index in the row above.                        3. Transmission of residue: the palette indices transmitted in Stage 2 are converted back to pixel values and used as the prediction. Residue information is transmitted using HEVC residual coding and is added to the prediction for the reconstruction.        
FIGS. 1A-C illustrate an exemplary of palette index map and palette index map coding according to screen content coding test model 2.0 (SCM-2.0). FIG. 1A illustrates a palette index map with palette indices 0 through 3 for palette colors and palette index 4 for Escape samples. The index corresponding to Escape samples is also referred as an Escape index in this disclosure. FIG. 1B illustrates palate index map coding according to SCM-2.0, where “copy-index mode” is applied to four groups (110, 120, 130 and 140) of the indices in the first row with “palette_runs” corresponding to 3, 1, 2, and 6. FIG. 1C illustrates an example of palette index map coding for the second row, wherein “copy-above mode” is applied to the first group of samples (150) and “copy-index mode” is applied to the next two groups (160 and 170) with runs corresponding to 8, 1 and 4.
Both the copy-index mode and copy-above mode are referred as “copy modes” in this disclosure. In the copy-index mode, the palette index of the leading pixel of the copy-index coded pixels is transmitted. The number of the copy-index coded pixels is also transmitted. At the decoder side, after determining the coding mode (i.e., copy-index mode) for the underlying pixels, only the information of the palette index of the leading pixel and the number of the copy-index coded pixels are needed to reconstruct the copy-index coded pixels. The pixels following the leading pixel can be reconstructed by “copying” from the predictor (i.e., the pixel on the left). The pixel value can be reconstructed using the palette table. In the copy-above mode, no palette index related to the predictors (i.e., the above pixels) needs to be transmitted since the above pixels have been reconstructed. The current pixels can be “copied” from the above pixels.
Palette Table Signaling
In the palette coding mode adopted in Screen context coding test model 2 (SCM-2.0, Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 18th Meeting: Sapporo, JP, 30 Jun.-9 Jul. 2014, Document: JCTVC-R1014), a palette predictor table is used to store previously coded/decoded palette colors such that they can be utilized as predictor for the palettes of subsequent blocks. When the decoder decodes the bitstream, the palette colors of the first palette-coded block will be stored in the palette predictor table. The next palette-coded block can use colors from this stored table as a palette predictor. For these colors not predicted by the palette predictor, new colors in its palette will be signaled. To reconstruct the palette of the current block, the syntax for reconstructing the palette is disclosed in SCM-2.0 and one example is shown as following.
Step 1: Signaling or Parsing the Palette.
In this step, the palette is signaled at the encoder side and reconstructed at the decoder side by first checking whether the palette_sharing flag (i.e., palette_sharing_flag) is set. If the palette_sharing_flag is set (i.e., having a value of 1), the current palette is the same as the palette of the previous block. Otherwise, the palette is reconstructed according to a palette updating procedure. An example of syntax structure for reconstructing the palette is shown below.
Parse ‘palette_sharing_flag’
If ‘palette_sharing_flag’ is equal to 1, current palette is the same as the previous block's palette
Otherwise,                Parse ‘reuse_flags’, to indicate which elements in the palette predictor table are reused in the current palette.        Parse ‘num_signalled_palette’, to indicate the number of new palette colors needs to be decoded for the current palette        Loop over ‘num_signalled_palette’, parse the palette color values        
Step 2. Signaling or Parsing the Color Index Map.
After the palette is signaled or reconstructed, the color index map is signaled at the encoder side or reconstructed at the decoder side using the reconstructed the palette and coded color indices as follows. The color index map is also referred as palette index map or index map in this disclosure.                Parse ‘scan order’ to indicate whether hor-traverse or ver-traverse        Parse ‘block_level_escape_flag’ to indicate whether there is ESCAPE samples ‘new run mode’ or ‘copy above mode’        If ‘copy index mode’, parse ‘index’                    If index=ESCAPE, parse ESCAPE sample value            If index!=ESCAPE, parse ‘run’ to indicate the number samples with the same index                        If ‘copy above mode’, parse ‘run’ to indicate the number samples with the same indices as the directly above samples        
It is desired to further improve the coding efficiency of color index map coding.